extends ../layout

block vars
  - var title = "设置头像"

block content
  .container-fluid.container.mt15
    .row-fluid
      .span9.left
        .container-box
          form.form-horizontal(action='http://up.qiniu.com/', method='POST', enctype='multipart/form-data')
            fieldset
              #legend
                legend 用户头像设置
              .control-group
                label.control-label(for='username') 头像
                .controls
                  img.avatar(src="#{user.avatarUrl('b')}", alt='')
                  img.avatar(src="#{user.avatarUrl('m')}", alt='')
                  img.avatar(src="#{user.avatarUrl('s')}", alt='')
                  a(href='/setting/avatar') 设置头像
              .control-group
                label.control-label(for='avatar') 上传
                .controls
                  input(name='key', type='hidden', value="#{key}")
                  input(name='token', type='hidden', value="#{uploadToken}")
                  input#avatar.input-xlarge(type='file', name='file', placeholder='')
                  p.help-block 请选择要上传的头像文件
              .control-group
                .controls
                  button.btn.btn-success 保存改动
                  a.ml10.btn(href='/setting/avatar/gravatar') 从Gravatar获取
                  a.ml10.btn(href='/setting') 返回设置页
      .span3.right
        .sidenav.container-box
          ul
            li
              a(href='/setting') 用户中心
              li.current
                a(href='/setting/avatar') 设置头像
              li
                a(href='/setting/password') 设置密码
              li
                a(href='/') 返回首页

